package com.luo.chengrui.module.sa.controller.admin.datapermission.vo;

import lombok.*;
import java.util.*;
import io.swagger.v3.oas.annotations.media.Schema;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;

import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;

@Schema(description = "管理后台 - 用来定义哪些业务表用来做权限控制，如部门表、费用科目、项目表。一般用来控制权限的都是基础数据表。分页 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class DataPermissionDefinePageReqVO extends PageParam {

    @Schema(description = "表名", example = "system_dept")
    private String tableName;

    @Schema(description = "表备注")
    private String tableDesc;

    @Schema(description = "主键字段名", example = "id")
    private String primaryKeyName;

    @Schema(description = "备注字段名")
    private String nameKey;

    @Schema(description = "父节点字段名", example = "parent_id")
    private String parentIdKeyName;

    @Schema(description = "外键字段名", example = "dept_id")
    private String foreignKeyName;

    @Schema(description = "根节点的值", example = "root_id")
    private String rootId;

    @Schema(description = "取数脚本", example = "sql_script")
    private String sqlScript;

    @Schema(description = "是否数据库表", example = "is_db_table")
    private Integer isDbTable;

    @Schema(description = "乐观锁")
    private Long version;

    @Schema(description = "创建时间")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
    private LocalDateTime[] createTime;

    @Schema(description = "更新时间")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
    private LocalDateTime[] updateTime;

}
